import request from "../request";

const controller = "Novel";

export const getNovelList_API = (data) => {
    return request.get(`${controller}/getNovelList?${queryStr(data)}`);
};

export const getNovelInfo_API = (data) => {
    return request.get(`${controller}/getNovelInfo?${queryStr(data)}`);
};



const queryStr = (data) => {
    let str = "";
    for (var key in data) {
        str += `${key}=${data[key]}&`;
    }
    if (str[str.length - 1] == "&") {
        str = str.substring(0, str.length - 1);
    }
    return str;
};
